Update client to support codified synapseAPI versioning scheme#178
Merged
Conversation
setup.py reads the canonical API version from the synapse-api
submodule's VERSION file and stamps it into synapse/_api_version.py.
The constant is re-exported from synapse so clients can do:
from synapse import SYNAPSE_API_VERSION
to compare against a server's reported version.
_api_version.py is committed (with the current 2.4.0 value) so that
sdist installs without the submodule still work; setup.py only updates
it when the submodule is present.
NOTE: requires bumping the synapse-api submodule pointer to a commit
that contains VERSION before the stamping path becomes active. The
current pointer (6c0905e) predates that file.
Previously printed only the science-synapse package version. Now also
prints the API version the client targets, so users debugging a
mismatch can see both at a glance:
$ synapsectl --version
synapsectl 2.5.0 (Synapse API 2.4.0)
Picks up the new VERSION file so setup.py's stamp_api_version() now has a source to read from. Without this bump the stamping was a no-op and synapse/_api_version.py would have drifted as a hand-edited file.
DeviceInfo.synapse_version is encoded by the server as a uint32 with the layout [major:8][minor:8][patch:16]. Add a decoder in synapse.utils.version and use it in the CLI's info display so users see "Synapse Version: 2.4.0" instead of "Synapse Version: 33816576".
Contributor
|
reminder to repin synapse-api to new head of main |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bump synapse-api version, reads and reports client API version, adds uint32->string parsing for device API version